#coding: utf-8
class CulturalHeritage::CollectionState < ActiveRecord::Base
  has_many :collection, :class_name => 'CulturalHeritage::Collection',  :foreign_key => 'collection'
  default_scope where("deleted = 0")

  def erasable
    care = CulturalHeritage::Collection.count_conservationalState_dependencies(id)
    if care>0
      return "Imposible borrar. Existen dependencias en colecciones"          
    end
    return nil
  end
end
